package com.gma.userprofile.info.platform

import com.gma.userprofile.util.{HBaseUtil, SparkUtil}

object UserProfileSubOpenId {
  def main(args: Array[String]): Unit = {

    //获取分区参数
    val ds = args.head

    //获取spark环境
    val spark = SparkUtil.getSparkSession

    //提取标签
    val tah = spark.sql(
      s"""
         |select
         |id,
         |case when mp_open_id is null or mp_open_id = '' then '否'
         |else '是' end as subOpenId
         |from
         |dim.dim_pub_user_info_d_f
         |where ds='$ds'
         |
         |""".stripMargin)

    //保存到hbase
    HBaseUtil.tagToHBase(tah, "subOpenId")

  }
}
